package com.example.demo.config;

import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

//系统配置文件
public class MyConfig implements WebMvcConfigurer {
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new LoginIntercept())
                .addPathPatterns("/**")
                .excludePathPatterns("/user/login")
                .excludePathPatterns("/user/reg")
                .excludePathPatterns("/art/getlistbypage")
                .excludePathPatterns("/art/detail")
                .excludePathPatterns("/editor.md/*")
                .excludePathPatterns("/img/*")
                .excludePathPatterns("/js/*")
                .excludePathPatterns("css/*")
                .excludePathPatterns("blog_list.html")
                .excludePathPatterns("blog_content.html")
                .excludePathPatterns("/reg.html")
                .excludePathPatterns("/login.html");
    }
}
